package com.rightsidetech.trade.dtos.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@ApiModel("导入订单")
@Data
public class TdCommodityImportReq implements Serializable {

    @ApiModelProperty("其他平台订单编号")
    @Length(max = 100,message = "其他平台订单编号长度不合法")
    @NotBlank(message = "其他平台订单编号不能为空")
    private String otherPaltformsOrderNo;

    @ApiModelProperty("联系人")
    @Length(max = 20,message = "联系人名称长度不合法")
    @NotBlank(message = "联系人不能为空")
    private String usName;

    @ApiModelProperty("手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[0-9]{10}$",message = "请输入正确的手机号")
    private String usPhoneNo;

    @ApiModelProperty("收货地址")
    @Length(max = 200,message = "收货地址长度不合法")
    @NotBlank(message = "收货地址不能为空")
    private String usAddress;

    @ApiModelProperty("总价格-元")
    @NotBlank(message = "总价格不能为空")
    private String totalAmount;

    @ApiModelProperty("优惠金额-元")
    @NotBlank(message = "优惠金额不能为空")
    private String discountAmount;

    @ApiModelProperty("实际金额-元")
    @NotBlank(message = "实际金额不能为空")
    private String actualAmount;

/*    @ApiModelProperty("门店名称")
    @Length(max = 20,message = "门店名称长度不合法")
    @NotBlank(message = "收货地址不能为空")
    private String storeName;*/

/*    @ApiModelProperty("订单类型,0-上门服务, 1-到店自取")
    @Pattern(regexp = "^上门服务|到店自取$",message = "订单类型不正确")
    @NotBlank(message = "订单类型不能为空")
    private String orderType;*/

    @ApiModelProperty("下单时间")
    @NotBlank(message = "下单时间不能为空")
    @Pattern(regexp = "^(((20[0-3][0-9]-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|(20[0-3][0-9]-(0[2469]|11)-(0[1-9]|[12][0-9]|30))) (20|21|22|23|[0-1][0-9]):[0-5][0-9]:[0-5][0-9])$",message = "下单时间格式不正确")
    private String createdAt;

    @ApiModelProperty("付款时间")
    @NotBlank(message = "付款时间不能为空")
    @Pattern(regexp = "^(((20[0-3][0-9]-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|(20[0-3][0-9]-(0[2469]|11)-(0[1-9]|[12][0-9]|30))) (20|21|22|23|[0-1][0-9]):[0-5][0-9]:[0-5][0-9])$",message = "付款时间格式不正确")
    private String payTime;

    @ApiModelProperty("订单来源, 0-系统, 1-淘宝, 2-京东, 3-抖音,4-拼多多, 5-天猫, 6-苏宁")
    @Pattern(regexp = "^淘宝|京东|抖音|拼多多|天猫|苏宁易购$",message = "订单来源不正确")
    @NotBlank(message = "订单来源不能为空")
    private String source;

/*    @ApiModelProperty("订单状态,  0-待付款,1-已支付(用户)/待接单,  2-已支付(用户)/已完成, 3-待接单售后申请，4-售后申请, 5-已退款, -1-取消订单")
    @Pattern(regexp = "^待支付|已接单|已完成$",message = "订单状态不正确")
    @NotBlank(message = "订单状态不能为空")
    private String orderStatus;*/

    @ApiModelProperty("商品名称")
    @Length(max = 20,message = "商品名称长度不合法")
    @NotBlank(message = "商品名称不能为空")
    private String commodityName;

/*    @ApiModelProperty(value = "商品分类")
    @Length(max = 20,message = "商品分类长度不合法")
    @NotBlank(message = "商品分类不能为空")
    private String typeName;

    @ApiModelProperty(value = "商品品牌")
    @Length(max = 20,message = "商品品牌长度不合法")
    @NotBlank(message = "商品品牌不能为空")
    private String brandName;*/

/*
    @ApiModelProperty("规格条码")
    private String barCode;
*/

    @ApiModelProperty(value = "商品规格")
    @Length(max = 200,message = "商品规格长度不合法")
    //@NotBlank(message = "商品规格不能为空")
    private String commoditySpecs;

    @ApiModelProperty("商品数量")
    @NotNull(message = "商品数量不能为空")
    private Integer commodityNum;

    @ApiModelProperty("单价")
    @NotBlank(message = "单价不能为空")
    private String commodityPrice;

    @ApiModelProperty("购买方式,  0-直接买新, 1-以旧换新")
    @Pattern(regexp = "^直接买新|以旧换新$",message = "订单状态不正确")
    @NotBlank(message = "购买方式不能为空")
    private String buyType;

}
